# Author:	gong_libin
# Date:		2014_08_12

CC ?= g++
CFLAGS ?= -Wall -O2

GT_ENV ?= /root/GtStream
GT_BIN ?= $(GT_ENV)/bin
GT_INC ?= $(GT_ENV)/inc
GT_SRC ?= $(GT_ENV)/src
GT_TST ?= $(GT_ENV)/test

GT_OBJS =					\
	GtRmSend.o				\
	GtRmInet.o				\
	GtRmUnix.o				\
	GtRmShm.o

GT_TGTS =					\
	GtRmSend				\
	GtRmInet				\
	GtRmUnix				\
	GtRmShm

all: $(GT_OBJS) $(GT_TGTS) install

$(GT_OBJS): %.o: %.c
	$(CC) -c $(CFLAGS) -I$(GT_INC) $< -o $@

$(GT_TGTS): %: %.o
	$(CC) $(CFLAGS) $< -o $@

install:
	cp $(GT_TGTS) $(GT_BIN)

clean:
	rm -rf $(GT_OBJS)
	rm -rf $(GT_TGTS)
